package com.gxa.service.impl;

import com.gxa.mapper.CurrentMapper;
import com.gxa.pojo.Current;
import com.gxa.service.CurrentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service("currentService")
public class CurrentServiceImpl implements CurrentService {
    @Resource
    private CurrentMapper currentMapper=null;
    //查询诊断
    @Override
    public Current findById(Integer id) {
        Current byId = currentMapper.findById(id);
        return byId;//问题
    }
//查询所有
    @Override
    public List findAll() {
        List<Map<String, Object>> all = currentMapper.findAll();
        return all;
    }
    //根据id查询辅助信息
    @Override
    public Current findAuxiliary(Integer id) {
        Current byId = currentMapper.findAuxiliary(id);
        return byId;//问题
    }
//根据id查询药物
    @Override
    public Current findMedicine(Integer id) {
        Current medicine = currentMapper.findMedicine(id);
        return medicine;
    }
    //根据id查询特殊
    @Override
    public Current findSpecial(Integer id) {
        Current special = currentMapper.findSpecial(id);
        return special;
    }

    @Override
    public boolean updateById(Current current) {
        boolean update = currentMapper.updateById(current);
        return update;
    }

    @Override
    public boolean updateAuxiliary(Current current) {
        boolean auxiliary = currentMapper.updateAuxiliary(current);
        return auxiliary;
    }

    @Override
    public Current findById2(Integer id) {
        Current byId2 = currentMapper.findById2(id);
        return byId2;
    }

    @Override
    public boolean update(Current current) {
        boolean update = currentMapper.update(current);
        return update;
    }
}
